package com.valuegroup.smarttodo.ui.cognize;


import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.valuegroup.smarttodo.R;
import com.valuegroup.smarttodo.ui.DataBackupActivity;
import com.valuegroup.smarttodo.ui.example.ExampleDateDialogActivity;
import com.valuegroup.smarttodo.ui.example.ExampleGroupRecyclerActivity;
import com.valuegroup.smarttodo.ui.example.ExampleIcarusEditorActivity;
import com.valuegroup.smarttodo.ui.example.ExampleProgressBarActivity;
import com.valuegroup.smarttodo.ui.example.ExampleSegmentedButtonActivity;
import com.valuegroup.smarttodo.ui.example.ExampleSimpleHomeActivity;

import androidx.fragment.app.Fragment;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;


/**
 * 认知-主页
 */
public class CognizeFragment extends Fragment {
    private static final String TAG = CognizeFragment.class.getSimpleName();
    @BindView(R.id.goGroupRecyclerExample)
    Button BtnGoGroupRecyclerExample;

    private Unbinder unbinder;

    @BindView(R.id.goProgressExample)
    Button btnGoProgressExample;

    @BindView(R.id.goSegmentedButtonExample)
    Button goSegmentedButtonExample;

    @BindView(R.id.goIcarusEditorExample)
    Button goIcarusEditorExample;

    @BindView(R.id.goFlytablayoutExample)
    Button goFlytablayoutExample;

    public CognizeFragment() {
    }

    public static CognizeFragment newInstance() {
        return new CognizeFragment();
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_cognize, container, false);
        unbinder = ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }

    @OnClick({R.id.goDateDialogExample, R.id.goProgressExample, R.id.goGroupRecyclerExample, R.id.goSegmentedButtonExample, R.id.goIcarusEditorExample, R.id.goFlytablayoutExample, R.id.goDataBackup})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.goProgressExample:
                startActivity(new Intent(getContext(), ExampleProgressBarActivity.class));
                break;
            case R.id.goGroupRecyclerExample:
                startActivity(new Intent(getContext(), ExampleGroupRecyclerActivity.class));
                break;
            case R.id.goSegmentedButtonExample:
                startActivity(new Intent(getContext(), ExampleSegmentedButtonActivity.class));
                break;
            case R.id.goIcarusEditorExample:
                startActivity(new Intent(getContext(), ExampleIcarusEditorActivity.class));
                break;
            case R.id.goFlytablayoutExample:
                startActivity(new Intent(getContext(), ExampleSimpleHomeActivity.class));
                break;
            case R.id.goDateDialogExample:
                startActivity(new Intent(getContext(), ExampleDateDialogActivity.class));
                break;
            case R.id.goDataBackup:
                startActivity(new Intent(getContext(), DataBackupActivity.class));
                break;
        }
    }
}
